Skip to content

Can enable debug logging of the gRPC calls. #1065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Can enable debug logging of the gRPC calls. #1065

merged 1 commit into from
Jun 17, 2022

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Jun 16, 2022

Motivation

Can enable the debug logging of the gRPC call to the Arduino CLI.

Change description

How to test:

  • Open the ~/.arduinoIDE/settings.json, you can use IDE2 or your favorite text editor,
  • Add "arduino.cli.daemon.debug": true to the settings.json file and save it,
  • Start the IDE2 from a terminal, see that debug calls, such as:
daemon INFO 3 |  RESP: {
3 |    "download_progress": {
3 |      "url": "https://downloads.arduino.cc/packages/package_index.tar.bz2",
3 |      "file": "Downloading index: package_index.tar.bz2",
3 |      "total_size": 41847
3 |    }
3 |  }
3 |  RESP: {
3 |    "download_progress": {
3 |      "downloaded": 41847
3 |    }
3 |  }
3 |  RESP: {
3 |    "download_progress": {
3 |      "completed": true
3 |    }
3 |  }

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos requested review from AlbyIanna and per1234 June 16, 2022 09:07
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jun 16, 2022
Comment on lines +163 to +165
if (debug) {
args.push('--debug');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be useful to let the user set the debug file too, like this:

Suggested change
if (debug) {
args.push('--debug');
}
if (debug) {
args.push('--debug');
if (debugFilePath) {
args.push('--debug-file');
args.push(debugFilePath);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but in that case, we should take care about deleting the file after every start-up, otherwise the file size will grow indefinitely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

I edited the commit message and the PR; my changes won't close #1056. I will let you wrap it up when you have figured out how to do the file-based logging.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kittaakos ok I asked @cmaglie to make a change in the arduino-cli in order to recreate the log file every time the IDE is restarted. In the meantime, I'm going to add the flag because it already works anyway

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is working perfectly for me and having access to this information has already proven to be very helpful for investigating behavior of the Arduino IDE and Arduino CLI.

Thanks Akos!

@kittaakos kittaakos merged commit 94ceefd into main Jun 17, 2022
@kittaakos kittaakos deleted the #1056 branch June 17, 2022 12:14
@per1234 per1234 linked an issue Jun 23, 2022 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add setting to enable Arduino CLI daemon debug output
3 participants